#pragma once

// 轮胎
#include <string>
#include "base_component.h"
using namespace std;

class Tire : public BaseComponent {
public:
    Tire();
    void print() override;
    int save(YAML::Node& node) override;
    int setDriveType(std::string driveType);
    int setMaxRange(std::string maxRange);
    int setTireSize(int tireSize);
    int setTireModel(std::string tireModel);

private:
    std::string _driveType;
    std::string _maxRange;
    std::string _tireModel;
    int _tireSize;
};

namespace YAML {
template <>
struct convert<Tire> {
    static bool decode(const Node& node, Tire& rhs) {
        rhs.setDriveType(node["driveType"].as<std::string>());
        rhs.setMaxRange(node["maxRange"].as<std::string>());
        rhs.setTireModel(node["tireModel"].as<std::string>());
        rhs.setTireSize(node["tireSize"].as<int>());
        return true;
    }
};
}  // namespace YAML